package com.yami.shop.rights.listener;

import com.yami.shop.bean.event.AddRightsEvent;
import com.yami.shop.rights.common.strategy.PersonRightsFactory;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;


@Slf4j
@Component("AddRightsListener")
@AllArgsConstructor
public class AddRightsListener {

    @Autowired
    private PersonRightsFactory personRightsFactory;

    /**
     * 功能描述: 新增持仓权益新增
     * @Author: LSR
     * @Date: 2023/4/18 16:09
     */
    @EventListener(AddRightsEvent.class)
    public void getProdRights(AddRightsEvent event) {
        log.info("增加权益信息===============================");
        personRightsFactory.addPersonRights(event);

    }

}
